package cn.stronglink.asset.module.lightData.service;

import java.util.Date;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.stronglink.asset.model.LightData;
import cn.stronglink.asset.module.lightData.mapper.LightDataMapper;

@Service
@Transactional(rollbackFor=Exception.class)
public class LightDataService {
	
	@Autowired
	private LightDataMapper lightMapper;


	public void updateStatus(String devAddrCode, boolean lightStatus) {
		lightMapper.updateStatus(devAddrCode,lightStatus);		
	}

	public void updateJsonDataLight(String rackCode, Integer u, boolean b) {
		LightData data = new LightData();
		data.setUpdateTime(new Date());
		data.setU(u);
		data.setHandLight(b);
		data.setRackConverCode(rackCode);
		lightMapper.updateJsonData(data);
		
	}

}
